Within network communications, any data received through a physical medium must be first decoded from its line-coding in the physical layer and then further decoded based on its particular network protocol in the data link and network layers to output a properly translated bitstream for use in higher level layers, such as the transport, session, or application layers. This decoding process has thus far been implemented on test and measurement instrumentation as protocol decoders specially written for each protocol type encountered by the instrumentation.
Using conventional Turing complete languages, such as C or Python, in writing protocol decoders, however, is time-consuming and error prone. Prior attempts to address problems with regular expressions in protocol description languages have encountered difficulties. For example, some protocol specifications are too complex to express in conventional declarative languages. Additionally, the grammars of conventional declarative languages may be insufficient to describe all the necessary protocol specifications, such as initial packet framing steps. For these reasons, decoding for physical signals and bitstreams is typically limited to a family of similar network protocol suites, such as ethernet traffic. Likewise, protocol analyzers are designed and coded for a particular protocol, which limits their ability to flexibly operate across a variety of incoming signals.